#pragma once
#include <qdialog.h>
#include <qgridlayout.h>
#include <qlayout.h>
#include <qstring.h>
#include <qbytearray.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qradiobutton.h>
#include <qpushbutton.h>
#include <qmessagebox.h>
#include <qcombobox.h>
#include <HupProtocal/HupProtocal.h>
#include <CmdJsonManager/CmdJsonManager.h>

class CmdAddDialogSingleton :public QObject
{
	Q_OBJECT
public:
	static CmdAddDialogSingleton& getInstance();
	void show();

	CmdAddDialogSingleton(CmdAddDialogSingleton&) = delete;
	CmdAddDialogSingleton(CmdAddDialogSingleton&&) = delete;
	CmdAddDialogSingleton& operator=(CmdAddDialogSingleton&) = delete;
	CmdAddDialogSingleton&& operator=(CmdAddDialogSingleton&&) = delete;

signals:
	void new_cmd_signal(QString name, QString data_format, QByteArray data);
private:
	CmdAddDialogSingleton();
	QDialog* cmd_dialog;
	QString name;
	QLineEdit* name_edit;
	QLineEdit* data_edit;
	QComboBox* hup_combo;
	QLineEdit* hup_cmd_edit;
	QRadioButton* text_radio;
	QRadioButton* hex_radio;
	QPushButton* sure;
	QPushButton* cancel;
};